package com.xiangge.domain;

// 创建继承父类person的子类
public class Player extends Person{
    // 定义属性
    private String action;
    private String score;

    // 定义行为,进行方法重写
    @Override
    public void introduction(){
        System.out.println("很高兴认识大家，我的名字是"+getName()+"，今年"+getAge()+"岁");
        System.out.println("是个"+action+"，今年拿到了"+score);
    }

    // 创建无参构造方法和有参构造方法
    public Player() {
    }
    public Player(String name, int age, String sex, String action, String score) {
        super(name, age, sex);
        this.action = action;
        this.score = score;
    }

    // 设置get和set方法，来调用私人属性
    public String getAction() {
        return action;
    }

    public void setAction(String action) {
        this.action = action;
    }

    public String getScore() {
        return score;
    }

    public void setScore(String score) {
        this.score = score;
    }
}